package com.szxy.frontend.search.config;

import org.apache.solr.client.solrj.SolrClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.solr.core.SolrTemplate;

/**
 * @Auther:zwer
 * @Date:2019/9/11 16:22
 * @Description:com.szxy.frontend.search.config
 * @Version:1.0
 **/
@Configuration
public class SolrConfig {

    @Autowired
    private SolrClient solrClient;

    /**
     * 创建 SolrTemplate 对象
     * @return
     */
    @Bean
    public SolrTemplate getSolrTemplate(){
        SolrTemplate solrTemplate = new SolrTemplate(solrClient);
        return solrTemplate;
    }

}
